import com.goexcursion.Excursion
import com.goexcursion.User

class BootStrap {

    def init = { servletContext ->
		createUsers()
		createExcursions()
    }
	
    def destroy = {
    }
	
	private createUsers(){
		def user1 = new User(email:"user1@oo.com").save()
		def user2 = new User(email:"user2@oo.com").save()
		def user3 = new User(email:"user3@oo.com").save()
	}
	
	private createExcursions(){
		Excursion excursion1 = new Excursion(name:"Torre Eifel",description:"Subir y patinar",latitude:12345, longitude:4567, creator:User.get(1)).save()
		Excursion excursion2 = new Excursion(name:"London Eye",description:"Dar la vuelta",latitude:12345, longitude:4567, creator:User.get(1)).save()
		Excursion excursion3 = new Excursion(name:"Muro de Los Lamentos", description:"Dejar papelito con rezo",latitude:12345, longitude:4567, creator:User.get(2)).save()
		Excursion excursion4 = new Excursion(name:"Valle Nevado",description:"Para Ski",latitude:12345, longitude:4567, creator:User.get(3)).save()
	}
}
